package tw.twandroidproj.app.ui.activity;

import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.ActionBarActivity;
import android.view.View;
import android.widget.Button;


import tw.twandroidproj.app.R;
import tw.twandroidproj.app.network.AuthManager;


public class SettingsActivity extends ActionBarActivity {
   private Button exitbutton;

    @Override
        protected void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.activity_settings);
        exitbutton= (Button) findViewById(R.id.exitbutton);
        exitbutton.setOnClickListener(new View.OnClickListener() {
            @Override

            public void onClick(View view) {

                AuthManager ExitAuth = AuthManager.getInstance(SettingsActivity.this);
                ExitAuth.logout();
                Intent intent = new Intent();
                intent.setClass(SettingsActivity.this, MainActivity.class);
                setResult(1,intent);
                finish();
            }
        });


    }

}
